<?php
class RealmName{
    public  function Realm(){
        $hotcat = $this->link();
        $key = array_rand($hotcat);
        $data = $hotcat[$key];
        foreach ($data as $k=>$v){
            $data['name'] = sha1($k);
            $data['url'] = sha1($v);
        }
        return $data;
    }
 private function link(){
     $hotcat =array(
         '0' => [
             'name'=>'百度',
             'url' =>'www.baidu.com'
         ],
         '1' => [
             'name'=>'新浪',
             'url' =>'www.sousuo.com'
         ],
         '2' => [
             'name'=>'360',
             'url' =>'www.360.com'
         ],
     );
     return $hotcat;
 }
}
